<template>
	<view class="box">
		<view class="bg"></view>
		<view class="list">
			<!-- 收货信息 -->
			<view class="msg card">
				<!-- 地址 -->
				<view class="address flex" @click="chooseAddress">
					<view class="msg-left">
						{{address.detail ||'暂时没有收货地址，请添加'}}
						<!-- <text class="msg-range" v-if="!range">(暂不在配送范围内，请修改地址)</text> -->
					</view>
					<view class="tag f-w">
						<image src="https://jw.xzsw2021.com/static/client/icon_108@2x.png" mode=""></image>
					</view>
				</view>
				<!-- 姓名电话 -->
				<view class="uname f-w c999 f22" v-if="address">
					<view>{{address.real_name}}</view>
					<view class="msg-phone">{{address.phone}}</view>
				</view>
				<!-- 配送时间 -->
				<view class="time fw-bt" @click="pop3Open">
					<view class="f26 bold">配送时间</view>
					<view class="f-w">
						<view class="f26 c999" :class="time?'showColor':''">{{time||'选择配送时间'}}</view>
						<view class="tag f-w">
							<image src="https://jw.xzsw2021.com/static/client/icon_108@2x.png" mode=""></image>
						</view>
					</view>
				</view>
				<!-- 买手信息 -->
				<view class="buy-msg fw-bt" @click="goBuyhand">
					<view class="f26 bold">选择买手</view>
					<view class="f-w">
						<view class="f26 c999" :class="buy_user?'showColor':''">
							{{ buy_user ? buy_user.real_name:'如果没选择买手，系统自动派单'}}
						</view>
						<view class="tag f-w">
							<image src="https://jw.xzsw2021.com/static/client/icon_108@2x.png" mode=""></image>
						</view>
					</view>
				</view>
			</view>
			<!-- 订单信息 -->
			<view class="order card">
				<view class="title f28 bold">订单信息</view>
				<view class="order-list">
					<template v-for="(merOrder,index) in checkinfo.order">
						<view class="shop f-w" v-for="(cartData,index2) in merOrder.list" :key="index2">
							<!-- <view class="cart1-add f-w" @click="updateCartData(cartData,1)">
								<image src="https://jw.xzsw2021.com/static/client/icon_84@2x.png" mode="">
								</image>
							</view> -->
							<!-- <view class="shop f-w"> -->
							<view class="shop-msg f-w">
								<image :src="cartData.productAttr.image" mode=""></image>
							</view>
							<view class="shop-right">
								<view class="one fw-bt">
									<view class="shop-name f28 c333 hide-line">{{cartData.product.store_name}}
									</view>
									<view class="f-w"
										style="flex-wrap: wrap;justify-content: flex-end;align-items: flex-end;"
										v-if="cartData.product.isCostar">
										<view class="price1" style="margin-left: 30rpx;">
											￥{{cartData.product.price}}
										</view>
										<view class="price2 f28 bold">
											￥{{cartData.product.costarPrice}} 搭配价
										</view>
									</view>
									<view class="f-w"
										style="flex-wrap: wrap;justify-content: flex-end;align-items: flex-end;" v-else>
										<view class="price1" style="margin-left: 30rpx;">
											<block v-if="cartData.productAttr.ot_price > 0">
												￥{{cartData.productAttr.ot_price}}</block>
										</view>
										<view class="price2 f28 bold">
											￥{{cartData.productAttr.price}}
										</view>
									</view>
								</view>
								<view class="three" style="color: indianred;font-size: 10px;">
									{{cartData.productAttr.sku}}
								</view>
								<view class="three">x{{cartData.cart_num}}</view>
								<!-- 购物车数量修改 -->
								<view class="cart-btn f-w" v-if="isagain!=1 && cartData.is_new == 0">
									<view class="cart1-jian f-w addkuangkuang" @click.stop="updateCartData(cartData,0)">
										<image src="https://jw.xzsw2021.com/static/client/icon_83@2x.png" mode="">
										</image>
									</view>
									<input type="number" v-model="cartData.cart_num" disabled>
									<view class="cart1-add f-w addkuangkuang" @click.stop="updateCartData(cartData,1)">
										<image src="https://jw.xzsw2021.com/static/client/icon_84@2x.png" mode="">
										</image>
									</view>
								</view>

							</view>
							<!-- </view> -->
						</view>
					</template>

					<!-- 
					商品详情 应该走校验单
					<view class="shop f-w" v-for="(item,index) of cart_list2" :key="index">
						<view class="shop-msg f-w">
							<image :src="item.product.image" mode=""></image>
						</view>
						<view class="shop-right">
							<view class="one fw-bt">
								<view class="shop-name f28 c333 hide-line">{{item.product.store_name}}</view>
								<view class="f-w" style="flex-wrap: wrap;">
									<view class="price1" v-if="item.attrValue[0].ot_price">
										￥{{item.attrValue[0].ot_price}}##</view>
									<view class="price2 f28 bold">￥{{item.product.price}}@@@</view>
								</view>
							</view>
							<view class="two hide-line">{{item.product.store_name}}</view>
							<view class="three">×{{item.cart_num}}</view>
						</view>
					</view>
					-->

				</view>
				<!-- 共5件 -->
				<view class="num fw-ct" v-if="cart_list.length>0" @click="showAll">
					共{{cart_list.length}}件
					<view class="tag2 f-w">
						<image src="https://jw.xzsw2021.com/static/img/icon_63@2x.png" mode="" v-if="showMore"></image>
						<image src="https://jw.xzsw2021.com/static/img/icon_62@2x.png" mode="" v-else></image>
					</view>
				</view>
				<!-- 包装费 -->
				<view class="fee1 fw-bt f28">
					<view>包装费</view>
					<view>￥{{checkinfo.order_total_package_fee}}</view>
				</view>
				<!-- 配送费 -->
				<view class="fee2 fw-bt f28">
					<view>配送费</view>
					<!-- <view>￥{{postfee}}</view> -->
					<view>￥{{((Number(postfee)+Number(checkinfo.order_total_free_postage_money_sum)).toFixed(2))}}
					</view>
				</view>
				<!-- 积分抵现 -->
				<view class="demo fw-bt" v-if="checkinfo.order_type != 1 && checkinfo.order_type != 4 ">
					<view class="f-w">
						<view class="img1 f-w">
							<image src="https://jw.xzsw2021.com/static/order/icon_138@2x.png" mode=""></image>
						</view>
						<view class="title2" @click="openPop2(1)">
							<view>
								积分抵现
								<view class="img2 f-w">
									<image src="https://jw.xzsw2021.com/static/order/icon_137@2x.png" mode=""></image>
								</view>
							</view>
						</view>
					</view>
					<!--  -->
					<view class="red f28" v-if="isShowIntegralShop">-￥{{checkinfo.order_total_integral_price}}</view>
					<view class="red f28" v-if="! isShowIntegralShop">未开启</view>
				</view>
				<!-- 积分抵现说 -->
				<view class="dixian fw-bt" @click="chooseDixian" v-if="isShowIntegralShop">
					<view class="f24 c666">
						<view v-if="is_dixian && checkinfo.order_total_integral_price == 0">
							购买商品不支持积分抵扣
						</view>
						<view v-else-if="is_dixian">
							可用{{checkinfo.order_total_integral}}积分抵扣￥{{checkinfo.order_total_integral_price}}
						</view>
						<view v-else>
							<!-- 共有{{}}积分可用 -->
						</view>
					</view>
					<view class="dixian-img f-w">
						<image src="https://jw.xzsw2021.com/static/order/icon_145@2x.png" mode="" v-if="!is_dixian">
						</image>
						<image src="https://jw.xzsw2021.com/static/order/icon_143@2x.png" mode="" v-else></image>
					</view>
				</view>
				<!-- 红包 -->
				<view class="demo fw-bt" v-if="checkinfo.order_type != 1 && checkinfo.order_type != 4 ">
					<!-- 左边 -->
					<view class="f-w">
						<view class="img1 f-w">
							<image src="https://jw.xzsw2021.com/static/order/icon_139@2x.png" mode=""></image>
						</view>
						<view class="title2" @click="openPop2(2)">
							红包
							<view class="img2 f-w">
								<image src="https://jw.xzsw2021.com/static/order/icon_137@2x.png" mode=""></image>
							</view>
						</view>
					</view>
					<!-- 满减红包使用 -->
					<view class="f-w" @click="openHbPop">
						<view class="red f28 c999" v-if="full_minus_sum">
							<template v-if="checkinfo.order_total_free_money_sum">
								-￥{{checkinfo.order_total_free_money_sum}}
							</template>
							<template v-else>
								有{{full_minus_sum}}个红包可用
							</template>
						</view>
						<view class="f28 c999" v-else>
							暂无可用红包
						</view>
						<view class="tag f-w">
							<image src="https://jw.xzsw2021.com/static/client/icon_108@2x.png" mode=""></image>
						</view>
					</view>
				</view>
				<!-- 配送费红包 -->
				<view class="demo fw-bt" v-if="checkinfo.order_type != 1 && checkinfo.order_type != 4 ">
					<!-- 左边 -->
					<view class="f-w">
						<view class="img1 f-w">
							<image src="https://jw.xzsw2021.com/static/order/icon_140@2x.png" mode=""></image>
						</view>
						<view class="title2" @click="openPop2(3)">
							配送费红包
							<view class="img2 f-w">
								<image src="https://jw.xzsw2021.com/static/order/icon_137@2x.png" mode=""></image>
							</view>
						</view>
					</view>
					<!-- 右边 -->
					<view class="f-w" @click="openPshbPop">
						<block v-if="checkinfo.order_total_free_postage_money_sum">
							<view class="red f28 c999">-￥{{checkinfo.order_total_free_postage_money_sum}}</view>
						</block>
						<block v-else>
							<view class="red f28 c999" v-if="free_postage_sum">有{{free_postage_sum}}个红包可用</view>
							<view class="f28 c999" v-else>暂无可用红包</view>
						</block>
						<view class="tag f-w">
							<image src="https://jw.xzsw2021.com/static/client/icon_108@2x.png" mode=""></image>
						</view>
					</view>
				</view>
				<!-- 优惠券 -->
				<view class="demo fw-bt" v-if="checkinfo.order_type != 1 && checkinfo.order_type != 4 ">
					<!-- 左边 -->
					<view class="f-w">
						<view class="img1 f-w">
							<image src="https://jw.xzsw2021.com/static/order/icon_141@2x.png" mode=""></image>
						</view>
						<view class="title2" @click="openPop2(4)">
							优惠券
							<view class="img2 f-w">
								<image src="https://jw.xzsw2021.com/static/order/icon_137@2x.png" mode=""></image>
							</view>
						</view>
					</view>
					<!-- 右边 -->
					<view class="f-w" @click="openYhPop">
						<block v-if="checkinfo.order_coupon_price > 0">
							<view class="f28 c999 red">-￥{{checkinfo.order_coupon_price}}</view>
						</block>
						<block v-else>
							<view class="red f28 c999" v-if="couponSum">
								有{{couponSum}}优惠券可用
							</view>
							<view class="f28 c999" v-else>
								暂无可用优惠券
							</view>


							<!-- <view :class="yh_desc?'red f28 c999':'f28 c999'">{{yh_desc||'暂无可用优惠券'}}</view> -->
						</block>


						<view class="tag f-w">
							<image src="https://jw.xzsw2021.com/static/client/icon_108@2x.png" mode=""></image>
						</view>
					</view>
				</view>


				<!-- 礼品卡 -->
				<view class="demo fw-bt"
					v-if="gift_card.length && (checkinfo.order_type != 1 && checkinfo.order_type != 4 )">
					<!-- 左边 -->
					<view class="f-w">
						<view class="img1 f-w">
							<image src="https://jw.xzsw2021.com/static/order/icon_141@2x.png" mode=""></image>
						</view>
						<view class="title2">
							礼品卡
						</view>
					</view>
					<!-- 右边 -->
					<!-- gift_card -->
					<picker mode="selector" :range="gift_card" range-key="title" @change="getgiftcard">
						<view class="f-w">
							<block v-if="choosecard">
								<view class="f28 c999 red">-￥{{choosecard.amount}}</view>
							</block>
							<block v-else>
								<view class="f28 c999">
									请选择礼品卡
								</view>
							</block>


							<view class="tag f-w">
								<image src="https://jw.xzsw2021.com/static/client/icon_108@2x.png" mode=""></image>
							</view>
						</view>
					</picker>
				</view>


				<!-- 已优惠 -->
				<view class="youhui fw-bt">
					<!--  -->
					<view class="f26 f-w">
						<text class="yyh">已优惠</text>
						<text class="red f28">￥<text class="f34">{{youhuiprice}}</text></text>
					</view>
					<!-- 小计 -->
					<view class="f26 f-w">
						<view class="xiaoji">小计</view>
						<view class="f28 f-w">
							￥
							<view class="youhui-total f40">
								{{checkinfo.order_price}}
								<view class="sanjiao"></view>
							</view>
						</view>
					</view>
				</view>
				<!-- plus节省 -->
				<view class="yh-plus f-w" v-if="VipDiscount.isShowDiscount && VipDiscount.isMember">
					<view class="img3 f-w">
						<image src="https://jw.xzsw2021.com/static/order/zhuanshi.png" mode="widthFix"></image>
					</view>
					<view>PLUS会员</view>
					<view class="tag3"></view>
					<view>本单已为您节省￥{{VipDiscount.money}}</view>
				</view>
				<view class="yh-plus fw-bt" v-if="VipDiscount.isShowDiscount &&  (!VipDiscount.isMember)">
					<view class="f-w">
						<view class="img3 f-w">
							<image src="https://jw.xzsw2021.com/static/order/zhuanshi.png" mode="widthFix"></image>
						</view>
						<view>成为PLUS会员</view>
						<view class="tag3"></view>
						<view>可为您节省￥{{VipDiscount.money}}</view>
					</view>
					<view class="red" @click="getPlus">去开通＞</view>
				</view>
			</view>
			<view class="card note fw-bt" v-for="merReduce in checkinfo.mer_reduce">
				<!-- <u-row customStyle="margin-bottom: 10px">
					<u-col span="6">
						{{merReduce.mer_name}}满{{merReduce.show_num}}件，打{{Number(merReduce.ratio) * 100}}折
					</u-col>
					<u-col span="6">
						订单原价：{{merReduce.pay_price}}
					</u-col>
					<u-col span="6">
						订单打折后：{{merReduce.new_price}}
					</u-col>
				</u-row> -->
				<view class="" style="color: #333;font-size: 28rpx;">
					<view class="" style="margin-bottom: 10rpx;">{{merReduce.mer_name}}满{{merReduce.show_num}}件，打 <text
							style="color: red;">{{(Number(merReduce.ratio) * 100 +'').replace('0','')}}</text> 折</view>
					<view class="" style="margin-bottom: 10rpx;">订单原价：{{merReduce.pay_price}}</view>
					<view class="">订单打折后：<text style="color: red;">{{merReduce.new_price}}</text></view>
				</view>
			</view>


			<!-- 备注 -->
			<view class="card note fw-bt" @click="openNote">
				<view class="f28 bold">备注</view>
				<view class="f-w">
					<view class="note-text f28 c999 hide-line">{{note||'未填写'}}</view>
					<view class="tag f-w">
						<image src="https://jw.xzsw2021.com/static/client/icon_108@2x.png" mode=""></image>
					</view>
				</view>
			</view>
			<!-- 支付方式 -->
			<view class="pay card">
				<view class="f28 bold title">支付方式</view>
				<!-- 微信 -->
				<view class="wx fw-bt" @click="checkPayWx">
					<view class="f-w">
						<view class="img4 f-w">
							<image src="https://jw.xzsw2021.com/static/order/icon_146@2x.png" mode=""></image>
						</view>
						<view class="f26">微信支付</view>
					</view>
					<view class="tag4">
						<image src="https://jw.xzsw2021.com/static/order/icon_145@2x.png" mode="" v-if="!pay_wx">
						</image>
						<image src="https://jw.xzsw2021.com/static/order/icon_143@2x.png" mode="" v-else></image>
					</view>
				</view>
				<!-- 余额支付 -->
				<view class="yue fw-bt" @click="checkPayYue">
					<view class="f-w">
						<view class="img4 f-w">
							<image src="https://jw.xzsw2021.com/static/order/icon_147@2x.png" mode=""></image>
						</view>
						<view class="f26">余额支付</view>
					</view>
					<view class="tag4">
						<image src="https://jw.xzsw2021.com/static/order/icon_145@2x.png" mode="" v-if="!pay_yue">
						</image>
						<image src="https://jw.xzsw2021.com/static/order/icon_143@2x.png" mode="" v-else></image>
					</view>
				</view>
			</view>

		</view>
		<!-- 支付 -->
		<view class="btn f-w">
			<view class="btn-left">
				<view class="f26 fw-ct">
					<view class="b1">合计</view>
					<view class="f22 b2">￥</view>
					<view class="bold f40 b3"> {{checkinfo.order_price}}</view>
				</view>
				<view class="f26">
					<text class="c999 ">共节省</text>
					<text class="red">￥{{youhuiprice}}</text>
				</view>
			</view>
			<view class="btn-mid f30 bold" @click="otherPay" style="position: relative;">

				找人付</view>
			<view class="btn-right f30 bold" @click="goPay">立即支付</view>
		</view>
		<!-- 备注弹窗 -->
		<uni-popup ref="popup" type="center" :isMaskClick="false">
			<view class="pop1">
				<view class="f30 bold tr title">备注信息</view>
				<textarea v-model="note1" placeholder="订单备注" />
				<view class="pop-btn f28 bold f-w">
					<view class="btn1" @click="noteCancel">取消</view>
					<view class="btn2" @click="noteSure">确认</view>
				</view>
			</view>
		</uni-popup>

		<!-- 确认代付 -->
		<uni-popup ref="paypopup" type="center" :isMaskClick="false">
			<view class="pop1">
				<view class="f30 bold tr title">是否邀请您的好友代付</view>
				<view class="" style="height: 70rpx;"></view>
				<view class="pop-btn f28 bold f-w">
					<view class="btn1" @click="daifuCancel">取消</view>
					<view class="btn2" style="position: relative;">
						<button open-type="share"
							style="width: 100%;height: 100%;position: absolute;top: 0;opacity: 0;"></button>
						确认
					</view>
				</view>
			</view>
		</uni-popup>

		<!-- 说明弹窗 -->
		<uni-popup ref="popup2" type="center" :isMaskClick="false">
			<view class="pop2">
				<view class="pop2-content">
					积分底线说明
				</view>
				<view class="pop2-close f-w" @click="pop2Close">
					<image src="https://jw.xzsw2021.com/static/index/icon_19@2x.png" mode=""></image>
				</view>
			</view>
		</uni-popup>
		<!-- 配送时间弹窗 -->
		<uni-popup ref="popup3" type="bottom" :isMaskClick="false" :safeArea="false">
			<view class="pop3">
				<!--  -->
				<view class="pop3-close f-w" @click="pop3Close">
					<image src="https://jw.xzsw2021.com/static/index/icon_19@2x.png" mode=""></image>
				</view>
				<view class="pop3-title tr f30">
					配送时间
				</view>
				<!-- 内容区 -->
				<view class="pop3-box flex">
					<view class="pop3-left">
						<view v-for="(item,index) of date_list" :key="index" class="tr"
							:class="active===index?'green2':''" @click="checkDate(index)">{{item}}</view>
					</view>
					<scroll-view class="pop3-right" scroll-y="true">
						<template v-for="(item,index) of times_list">
							<view class="aa fw-bt" :key="index" @click="chooseTimes(index)" style="padding: 30rpx;">
								<view :class="active2 === index?'green2':''" v-if="active == 0"
									:style="item.isValid?'':'color:#999'">
									{{item.tips}}{{item.start}}-{{item.end}}
								</view>
								<view :class="active2 === index?'green2':''" v-else>
									{{index == 0?'立即送达':''}}{{item.start}}-{{item.end}}
								</view>
								<view class="pop3-img" v-if="active2===index">
									<image src="https://jw.xzsw2021.com/static/order/icon_149@2x.png" mode=""></image>
								</view>
							</view>
						</template>
					</scroll-view>
				</view>
			</view>
		</uni-popup>
		<!-- 红包弹窗 -->
		<uni-popup ref="popup4" type="bottom" :isMaskClick="false" :safeArea="false" :safe-area='false'>
			<view class="pop4">
				<!-- 关闭按钮 -->
				<view class="pop4-close f-w" @click="pop4Close">
					<image src="https://jw.xzsw2021.com/static/index/icon_19@2x.png" mode=""></image>
				</view>
				<view class="pop4-title f32 tr">红包</view>
				<scroll-view class="pop4-list" scroll-y="true">
					<view class="pop4-card flex" v-for="(item,index) of checkinfo.red_packet_data.reduction"
						:key="index" @click="checkHb(index)">
						<!-- 选中 -->
						<view class="pop4-img">
							<image src="https://jw.xzsw2021.com/static/order/icon_143@2x.png" mode=""
								v-if="item.is_select"></image>
							<image src="https://jw.xzsw2021.com/static/order/icon_145@2x.png" mode="" v-else></image>
						</view>
						<view class="left">
							<view class="price">￥<text class="f40">{{item.red_packet_price}}</text></view>
							<view class="tj" v-if="item.use_min_price > 0">满{{item.use_min_price}}可用</view>
							<view class="tj" v-else>不限</view>
						</view>
						<view class="right">
							<view class="one">{{item.red_name}}</view>
							<view class="two">领取时间：{{item.create_date}}</view>
							<view class="two" v-if="item.end_date">失效时间：{{item.end_date}}</view>
							<view class="two" v-if="item.is_usable == false">不可用</view>
							<view class="three flex" @click.stop="zhankai(index)">
								<view>
									<view class="desc" :class="!item.look?'hide-line':''">{{item.desc}}</view>
								</view>
								<view class="icon" v-if="item.desc.length>17">
									<image src="https://jw.xzsw2021.com/static/img/icon_62@2x.png" mode=""
										v-if="!item.look"></image>
									<image src="https://jw.xzsw2021.com/static/img/icon_63@2x.png" mode="" v-else>
									</image>
								</view>
							</view>
						</view>
					</view>
				</scroll-view>
			</view>
		</uni-popup>

		<!-- 优惠券 -->
		<uni-popup ref="coupons" type="bottom" :isMaskClick="false" :safeArea="false" :safe-area='false'>
			<view class="pop4">
				<!-- 关闭按钮 -->
				<view class="cancelbox" @click="cancelcoupon">取消选择</view>
				<view class="pop4-close f-w" @click="()=>{this.$refs.coupons.close()}">
					<image src="https://jw.xzsw2021.com/static/index/icon_19@2x.png" mode=""></image>
				</view>
				<view class="pop4-title f32 tr">优惠券</view>
				<scroll-view class="pop4-list" scroll-y="true">
					<view class="pop4-card flex" v-for="(item,index) of couponlist" :key="index"
						@click="checkcoupon(index)">
						<!-- 选中 -->
						<view class="pop4-img">
							<image src="https://jw.xzsw2021.com/static/order/icon_145@2x.png" mode=""
								v-if="!item.is_choose"></image>
							<image src="https://jw.xzsw2021.com/static/order/icon_143@2x.png" mode="" v-else></image>
						</view>
						<view class="left" style="width: 200rpx;">
							<view class="price">￥<text class="f40 red">{{item.coupon_price}}</text></view>
							<view class="tj">满{{item.use_min_price}}可用</view>
						</view>
						<!-- 				<view class="right">
							<view class="one">{{item.name}}</view>
							<view class="two">{{item.time}}</view>
							<view class="three flex" @click.stop="zhankai(index)">
								{{item.start_time}}-{{item.end_time}}	
							</view>
						</view> -->
						<view class="right">
							<view class="one f26">{{item.coupon_title}}</view>
							<view class="two f24">
								<text style="display: block; width: 300rpx">{{item.start_time}}-{{item.end_time}}</text>
								<view class="lright-lq">已领取</view>
							</view>
						</view>

					</view>
				</scroll-view>

			</view>
		</uni-popup>
		<!-- <coupons ref="coupons" :quan_list="couponlist" @getid='getid'></coupons>/ -->
		<uni-popup ref="popup5" type="bottom" :isMaskClick="false" :safeArea="false" :safe-area='false'>
			<view class="pop4">
				<!-- 关闭按钮 -->
				<view class="pop4-close f-w" @click="closeShowPostagePop">
					<image src="https://jw.xzsw2021.com/static/index/icon_19@2x.png" mode=""></image>
				</view>
				<view class="pop4-title f32 tr">红包</view>
				<scroll-view class="pop4-list" scroll-y="true">
					<view class="pop4-card flex" v-for="(item,index) of checkinfo.red_packet_data.free_ship"
						:key="index" @click="checkHbPostage(index)">
						<!-- 选中 -->
						<view class="pop4-img">
							<image src="https://jw.xzsw2021.com/static/order/icon_143@2x.png" mode=""
								v-if="item.is_select"></image>
							<image src="https://jw.xzsw2021.com/static/order/icon_145@2x.png" mode="" v-else></image>
						</view>
						<view class="left">
							<view class="price">￥<text class="f40">{{item.red_packet_price}}</text></view>
							<view class="tj" v-if="item.use_min_price > 0">满{{item.use_min_price}}可用</view>
							<view class="tj" v-else>不限</view>
						</view>
						<view class="right">
							<view class="one">{{item.red_name}}</view>
							<view class="two">领取时间：{{item.create_date}}</view>
							<view class="two" v-if="item.end_date">失效时间：{{item.end_date}}</view>
							<view class="two" v-if="item.is_usable == false">不可用</view>
							<view class="three flex" @click.stop="zhankai(index)">
								<view>
									<view class="desc" :class="!item.look?'hide-line':''">{{item.desc}}</view>
								</view>
								<view class="icon" v-if="item.desc.length>17">
									<image src="https://jw.xzsw2021.com/static/img/icon_62@2x.png" mode=""
										v-if="!item.look"></image>
									<image src="https://jw.xzsw2021.com/static/img/icon_63@2x.png" mode="" v-else>
									</image>
								</view>
							</view>
						</view>
					</view>
				</scroll-view>
			</view>
		</uni-popup>

		<!-- 	  <uni-popup ref="popup2" type="center" :isMaskClick="false">
		  	<view class="pop2">
		  		<view class="pop2-content">
		  			积分底线说明
		  		</view>
		  		<view class="pop2-close f-w" @click="pop2Close">
		  			<image src="https://jw.xzsw2021.com/static/index/icon_19@2x.png" mode=""></image>
		  		</view>
		  	</view>
		  </uni-popup> -->


	</view>
</template>

<script>
	import {
		cartChangeApi
	} from '@/api/cart.js'
	import {
		getUserAddressListApi,
		getVipListApi
	} from '@/api/user'
	import {
		getOrderDeliveryTimeConfigApi
	} from '@/api/order.js'

	// import Base64 from "js-base64/base64.js"
	import Cache from '@/util/cache.js'
	export default {
		data() {
			return {
				gift_card: [],
				choosecard: '',
				choosecoupon: '',
				couponlist: [],
				cartData: '',
				postfee: 0, //运费
				youhuiprice: 0, //已经优惠金额
				vipprice: 0, //会员
				checkinfo: '',
				showMore: false, //展示全部
				range: true, //配送范围
				isShowIntegralShop: false, //是否显示使用积分抵扣
				address: {},
				time: '',
				buy_user: '', //买手信息
				cart_list: [], //
				is_dixian: false, //是否抵现
				pay_wx: true, //支付方式 1微信 0余额
				pay_yue: false,
				note1: '', //待用备注
				note: '', //备注
				date_list: ['今天', '明天'], //
				active: 0, // date_list[active]
				active2: '', //
				times_list: [], //送达时间列表
				pshb_list: [{}], //配送红包列表
				yh_list: [{}], //优惠券列表
				VipDiscount: { //会员优惠
					isShowDiscount: false, //是否显示会员优惠
					isMember: true, //是否为会员优惠  false为 如果是会员会优惠多少
					money: 0 //会员会优惠的金额
				},
				free_postage_red_id: 0, //免运费红包 id
				full_minus_red_id: 0, //满减红包
				full_minus_sum: 0, //可用满减红包数量
				free_postage_sum: 0, //可用免运费红包数量
				isagain: 0,
				couponSum: 0, //可用优惠券数量
				is_show_postage_pop: false, //是否弹窗选择配送费红包
				share_: {
					group_order_id: 0,
					img: ''
				}
			}
		},
		onLoad(e) {
			// this.cart_list = JSON.parse(Base64.decode(e.arr))
			this.cart_list = JSON.parse(Cache.get('cartToPayCheck'))
			if (e.isagain) {
				this.isagain = e.isagain
			}
			this.getbuyer()
		},
		onShow() {
			this.getgitfcard()
			if (this.share_.group_order_id == 0) {
				this.check()
			}


		},
		onShareAppMessage(e) {
			return {
				title: '好友帮付订单',
				imageUrl: this.share_.img,
				path: `/pages/client/order/order-sure2/order-sure2?group_order_id=${this.share_.group_order_id}`,
			}
		},
		mounted() {
			let This = this
			if (Cache.get('user_address', true) !== true) {
				this.address = Cache.get('user_address', true)
				this.check()
				return;
			}
			getUserAddressListApi().then(res => {
				res.data.list.forEach(addr => {
					if (addr.is_default) {
						This.address = addr
					}
				})
				this.check()
			}).catch(err => {
				this.check()
			})
		},
		methods: {
			getgitfcard() {
				this.$request('user/card', {}, 'GET').then(res => {
					let arr = []
					res.data.data.forEach(item => {
						if (item.status == 0) {
							arr.push(item)
						}
					})
					this.gift_card = arr
				})
			},
			// 选择礼品卡
			getgiftcard(e) {
				this.choosecard = this.gift_card[e.detail.value]
				this.check()
			},
			timesList() {
				getOrderDeliveryTimeConfigApi().then(res => {
					this.times_list = res.data
					console.log(res)
				}).catch(err => {

				})
			},
			updateCartData(cart, type) {
				let original = cart.cart_num
				if (type) {
					cart.cart_num += 1
				} else {
					cart.cart_num -= 1
				}
				if (cart.cart_num <= 0) {
					cart.cart_num = 1
					uni.showToast({
						title: "最低不能少于一个",
						icon: "none"
					})
					return;
				}
				let cart_num = cart.cart_num
				cartChangeApi(cart.cart_id, {
					cart_num
				}).then(res => {
					this.check()
				}).catch(err => {
					cart.cart_num = original
				})

			},
			// 获取买家列表
			getbuyer() {
				let mar = JSON.parse(Cache.get('market'))
				let data = {
					mar_id: mar.id
				}
				this.$request('buyer/lst', data, 'GET').then(res => {
					if (res.status == 200) {


					}
				})

			},
			cancelcoupon() {
				this.choosecoupon = ''
				this.$refs.coupons.close()
				this.check()
			},
			// 选择优惠券
			checkcoupon(e) {
				let list = this.couponlist
				let item = list[e]
				this.choosecoupon = item
				this.$refs.coupons.close()
				this.check()
			},
			// v2/order/check
			check() {
				this.timesList()
				let obj = {}
				let list2 = this.cart_list
				let price = 0
				let mark = {}
				let use_coupon = {}
				list2.forEach(item => {
					price = price + item.cart_num * 1 * (item.product.price * 1)
					let id = item.mer_id
					let cid = []
					this.$set(use_coupon, `${id}`, cid)
					this.$set(mark, `${id}`, this.note)
				})
				if (this.choosecoupon) {
					this.$set(use_coupon, this.choosecoupon.mer_id, this.choosecoupon.coupon_user_id)
				}

				let arr = []
				let list = this.cart_list
				list.forEach(item => {
					arr.push(item.cart_id)
				})
				let data = {
					address_id: this.address ? this.address.address_id : '',
					cart_id: arr,
					takes: [],
					use_integral: this.is_dixian,
					use_coupon,
					full_minus_red_id: this.full_minus_red_id,
					free_postage_red_id: this.free_postage_red_id,
					card_id: this.choosecard ? this.choosecard.id : ''
				}
				this.$request('v2/order/check', data).then(res => {
					if (res.status == 200) {
						this.checkinfo = res.data
						this.isShowIntegralShop = res.data.openIntegral //订单是否有可用积分抵扣
						// 优惠券列表
						let arr = []
						let arr2 = [] //优惠券
						let couponSum = 0 //可用优惠券数量
						let postfee = Number(this.checkinfo.order_total_postage_price) //运费
						res.data.order.forEach(item => {
							// postfee = postfee + item.order.postage_price * 1
							arr = arr.concat(item.coupon)
						})
						console.log(arr, '----------')
						arr.forEach(item => {
							item.is_choose = false
							if (item.disabled == false) {
								couponSum += 1
							}
							if (item.checked && item.coupon.type == 2) { //使用了免运费券
								postfee += Number(this.checkinfo.order_coupon_price)
							}
							arr2.push(item)
						})
						// console.log(JSON.stringify(arr2), '**************@@@@@@@@@@')
						this.postfee = postfee.toFixed(2)
						this.couponlist = arr2
						// this.youhuiprice = (price * 1 - this.checkinfo.order_price * 1).toFixed(2)



						let fullSum = 0
						let FreeSum = 0

						this.checkinfo.red_packet_data.reduction.forEach(item => {
							if (item.is_usable) {
								fullSum += 1
							}
						})
						this.checkinfo.red_packet_data.free_ship.forEach(item => {
							if (item.is_usable) {
								FreeSum += 1
							}
						})
						this.full_minus_sum = fullSum
						this.free_postage_sum = FreeSum
						this.couponSum = couponSum
						console.log(this.couponlist)

						this.getvipprice()
					}
				}).catch(err => {
					this.is_dixian = false
				})
			},
			// 获取会员的价格 & 计算已享受优惠金额
			getvipprice() {
				let This = this
				let VipProductPayMoney = 0 //可vip折扣的商品总金额
				This.VipDiscount.money = 0 //每次校验后归零
				This.youhuiprice = 0 //已经优惠
				this.checkinfo.order.forEach(merOrder => {
					if (merOrder.order.total_vip_discount_price) {
						This.VipDiscount.money += Number(merOrder.order.total_vip_discount_price)
						This.VipDiscount.money = Number(This.VipDiscount.money.toFixed(2))
					}
					merOrder.list.forEach(cartList => {
						if (cartList.product.reduceMoeny > 0) {
							This.youhuiprice += Number(cartList.product.reduceMoeny) //满件打折 减少金额
						}

						if (cartList.productAttr.is_member_discount) {
							This.VipDiscount.isShowDiscount = true //购买商品有会员折扣
							VipProductPayMoney += Number(cartList.cart_num) *
								Number(cartList.productAttr.price)
						}
					})
				})
				This.youhuiprice += Number(This.checkinfo.order_coupon_price) //优惠券
				This.youhuiprice += Number(This.checkinfo.order_total_free_postage_money_sum) ///整个订单免运费红包总金额
				This.youhuiprice += Number(This.checkinfo.order_total_free_money_sum) //整个订单满减红包总金额
				This.youhuiprice += Number(This.checkinfo.order_total_integral_price) //整个订单积分抵扣金额
				This.youhuiprice += Number(This.VipDiscount.money) //vip 打折优惠金额
				This.youhuiprice += Number(This.checkinfo.order_total_card_price) //礼品卡抵扣金额
				This.youhuiprice = Number(This.youhuiprice.toFixed(2))

				if (this.VipDiscount.isShowDiscount && This.VipDiscount.money == 0 &&
					VipProductPayMoney) { //说明购买商品有会员折扣 并且用户非会员
					this.VipDiscount.isMember = false
					getVipListApi().then(res => {
						res.data.forEach(vip => {
							if (vip.discount > 0) {
								let ratio = Number(vip.discount)
								if (ratio >= 1) {
									ratio = ratio / 100
								}
								ratio = 1 - ratio.toFixed(2)
								This.VipDiscount.money = VipProductPayMoney * ratio
								This.VipDiscount.money = Number(This.VipDiscount.money.toFixed(2))
							}
						})
					})

				}
			},
			// 选择收货地址
			chooseAddress() {
				uni.navigateTo({
					url: '/pages/client/address-choose/address-choose?orgin=1'
				})
			},
			// 选择买手
			goBuyhand(id) {
				uni.navigateTo({
					url: '/pages/client/buyhand/buyhand?id=' + id
				})
			},
			// 积分抵现
			chooseDixian() {
				this.is_dixian = !this.is_dixian;
				this.check()
			},
			// 显示商品
			showAll() {
				this.showMore = !this.showMore;

			},
			// 打开时间弹窗
			pop3Open() {
				this.$refs.popup3.open();
			},
			// 关闭时间弹窗
			pop3Close() {
				this.$refs.popup3.close();
			},
			// 选择日期
			checkDate(index) {
				this.active = index
				this.active2 = ''
				this.timesList()
			},
			// 选择配送时间
			chooseTimes(index) {
				if (!this.times_list[index].isValid && this.active != 1) {
					uni.showToast({
						title: "时间已过",
						icon: "none"
					})
					return;
				}
				this.active2 = index;
				this.time = this.date_list[this.active] + this.times_list[this.active2].tips + this.times_list[this
					.active2].start + '-' + this.times_list[this.active2].end
				this.$refs.popup3.close();
			},
			// 开通plus
			getPlus() {
				console.log('开通plus');
				uni.redirectTo({
					url: "/pages/user/plus/plus"
				})
			},
			// 打开说明
			openPop2(index) {
				this.$refs.popup2.open();
				if (index == 1) {
					console.log('积分底线说明');
				}
				if (index == 2) {
					console.log('红包说明');
				}
				if (index == 3) {
					console.log('配送红包说明');
				}
				if (index == 4) {
					console.log('优惠券说明');
				}
			},
			// 关闭说明
			pop2Close() {
				this.$refs.popup2.close()
			},
			// 备注
			openNote() {
				this.$refs.popup.open()
				if (this.note) {
					this.note1 = this.note;
				}
				console.log(this.note)
			},
			// 备注取消
			noteCancel() {
				this.note1 = '';
				this.$refs.popup.close()
			},
			// 备注确认
			noteSure() {
				this.note = this.note1;
				this.$refs.popup.close()
			},
			// 选择微信支付
			checkPayWx() {
				this.pay_wx = true;
				this.pay_yue = false
			},
			// 选择余额支付
			checkPayYue() {
				this.pay_yue = true;
				this.pay_wx = false
			},
			// 找人支付
			otherPay() {

				// console.log("去支付")return;
				if (!this.time) {
					uni.showToast({
						title: "请选择配送时间",
						icon: "none"
					})
					return
				}
				let obj = {}
				let list2 = this.cart_list
				let price = 0
				let mark = {}
				let use_coupon = {}
				list2.forEach(item => {
					price = price + item.cart_num * 1 * (item.product.price * 1)
					let id = item.mer_id
					let cid = []
					this.$set(use_coupon, `${id}`, cid)
					this.$set(mark, `${id}`, this.note)
				})

				if (this.choosecoupon) { //这样弄一个订单只能选择一个优惠券，多商户时应该选多个的
					this.$set(use_coupon, this.choosecoupon.mer_id, this.choosecoupon.coupon_user_id)
				}
				let arr = []
				let list = this.cart_list
				list.forEach(item => {
					arr.push(item.cart_id)
				})
				let date
				if (this.date_list[this.active] == '今天') {
					date = this.getDay(0, 3600000)
				} else {
					date = this.getDay(1, 3600000)
				}

				let delivery_start_date = date + ' ' + this.times_list[this.active2].tips +
					this.times_list[this.active2].start
				let delivery_end_date = date + ' ' + this.times_list[this.active2].tips +
					this.times_list[this.active2].end
				let delivery_time_scope = this.times_list[this.active2].start + '-' +
					this.times_list[this.active2].end


				//             if(!this.buy_user){
				//  uni.showToast({
				//  	title: "请选择买手",
				//  	icon: "none"
				//  })
				//  return
				// }

				let data = {
					address_id: this.address ? this.address.address_id : '',
					cart_id: arr,
					takes: [],
					use_integral: this.is_dixian,
					use_coupon,
					order_type: 0,
					pay_type: 'routine',
					mark: mark,
					delivery_start_date,
					delivery_end_date,
					delivery_time_scope,
					buyer_type: this.buy_user.uid,
					full_minus_red_id: this.full_minus_red_id,
					free_postage_red_id: this.free_postage_red_id,
					card_id: this.choosecard ? this.choosecard.id : ''
				}



				uni.requestSubscribeMessage({
					tmplIds: ['Gb-9p4oMrDUHDDoovy6oZ4G6GptHSkHyQ_BKzubLkIY'],
					success: re => {
						this.$request('v2/order/create', data).then(res => {
							if (res.status == 200) {
								let groupOrderId = res.data.result.order_id
								this.share_.group_order_id = groupOrderId
								this.$refs.paypopup.open()
								//去帮付
								// uni.navigateTo({
								// 	url: `/pages/client/order/order-sure2/order-sure2?group_order_id=${groupOrderId}`
								// })
							}
						})
					},
					fail: err => {
						this.$request('v2/order/create', data).then(res => {
							if (res.status == 200) {
								let groupOrderId = res.data.result.order_id
								this.share_.group_order_id = groupOrderId
								this.$refs.paypopup.open()
								//去帮付
								// uni.navigateTo({
								// 	url: `/pages/client/order/order-sure2/order-sure2?group_order_id=${groupOrderId}`
								// })
							}
						})
					},

				})





			},
			daifuCancel() {
				this.$refs.paypopup.close()
				uni.redirectTo({
					url: "/pages/client/order/order?type=0"
				})


			},
			log(i) {
				console.log(i)
			},
			// 立即支付
			goPay() {
				// console.log("去支付");
				// console.log(this.checkinfo);
				// return;
				if (!this.time) {
					uni.showToast({
						title: "请选择配送时间",
						icon: "none"
					})
					return
				}
				let This = this
				let obj = {}
				let list2 = this.cart_list
				let price = 0
				let mark = {}
				let use_coupon = {}
				list2.forEach(item => {
					price = price + item.cart_num * 1 * (item.product.price * 1)
					let id = item.mer_id
					let cid = []
					this.$set(use_coupon, `${id}`, cid)
					this.$set(mark, `${id}`, this.note)
				})

				if (this.choosecoupon) { //这样弄一个订单只能选择一个优惠券，多商户时应该选多个的
					this.$set(use_coupon, this.choosecoupon.mer_id, this.choosecoupon.coupon_user_id)
				}


				let arr = []
				let list = this.cart_list
				list.forEach(item => {
					arr.push(item.cart_id)
				})
				let date
				if (this.date_list[this.active] == '今天') {
					date = this.getDay(0, 3600000)
				} else {
					date = this.getDay(1, 3600000)
				}

				let delivery_start_date = date + ' ' + this.times_list[this.active2].tips +
					this.times_list[this.active2].start
				let delivery_end_date = date + ' ' + this.times_list[this.active2].tips +
					this.times_list[this.active2].end
				let delivery_time_scope = this.times_list[this.active2].start + '-' +
					this.times_list[this.active2].end

				let data = {
					address_id: this.address ? this.address.address_id : '',
					cart_id: arr,
					takes: [],
					use_integral: this.is_dixian,
					use_coupon,
					order_type: 0,
					pay_type: this.pay_wx ? 'routine' : 'balance',
					mark: mark,
					delivery_start_date,
					delivery_end_date,
					delivery_time_scope,
					buyer_type: this.buy_user.uid,
					full_minus_red_id: this.full_minus_red_id,
					free_postage_red_id: this.free_postage_red_id,
					card_id: this.choosecard ? this.choosecard.id : ''
				}

				uni.requestSubscribeMessage({
					tmplIds: ['Gb-9p4oMrDUHDDoovy6oZ4G6GptHSkHyQ_BKzubLkIY'],
					success: re => {
						uni.showLoading({
							mask: true
						})
						this.$request('v2/order/create', data).then(res => {
							if (res.status == 200) {
								uni.hideLoading()
								if (this.pay_wx) {
									this.paying(res.data.result.config)
								} else {
									uni.showToast({
										title: res.message,
										icon: "none"
									})
									if (This.checkinfo.order_type == 4) { //拼团
										let url_ = "/pages/state/success/success?type=13"
										if (res.data.status == 'error') {
											url_ = '/pages/client/order/order?type=1'
										}
										let getTimeOutId = setTimeout(function() {
											uni.reLaunch({
												url: url_,
												success() {
													clearTimeout(getTimeOutId) //释放定时
												}
											})
										}, 1500)
									} else {
										let timeOutId = setTimeout(function() {
											uni.reLaunch({
												url: "/pages/client/order/order",
												success() {
													clearTimeout(timeOutId) //释放定时
												}
											})
										}, 1500)
									}
								}

							}
						})
					},
					fail: err => {
						uni.showLoading({
							mask: true
						})
						this.$request('v2/order/create', data).then(res => {
							if (res.status == 200) {
								uni.hideLoading()
								if (this.pay_wx) {
									this.paying(res.data.result.config)
								} else {
									uni.showToast({
										title: res.message,
										icon: "none"
									})
									if (This.checkinfo.order_type == 4) { //拼团
										let url_ = "/pages/state/success/success?type=13"
										if (res.data.status == 'error') {
											url_ = '/pages/client/order/order?type=1'
										}
										let getTimeOutId = setTimeout(function() {
											uni.reLaunch({
												url: url_,
												success() {
													clearTimeout(getTimeOutId) //释放定时
												}
											})
										}, 1500)
									} else {
										let timeOutId = setTimeout(function() {
											uni.reLaunch({
												url: "/pages/client/order/order",
												success() {
													clearTimeout(timeOutId) //释放定时
												}
											})
										}, 1500)
									}
								}

							}
						})
					},

				})






			},
			// 支付
			paying(e) {

				let that = this
				let orderInfo = {
					timeStamp: e.timestamp,
					nonceStr: e.nonceStr,
					package: e.package,
					signType: e.signType,
					paySign: e.paySign,
				}
				wx.requestPayment({
					...orderInfo,

					success: (res) => {
						if (that.checkinfo.order_type == 4) {
							let getTimeOutId = setTimeout(function() {
								uni.reLaunch({
									url: "/pages/state/success/success?type=13",
									success() {
										clearTimeout(getTimeOutId) //释放定时
									}
								})
							}, 1500)
						} else {
							let TimeID = setTimeout(function() {
								uni.reLaunch({
									url: "/pages/client/order/order",
									success() {
										clearTimeout(TimeID)
									},
									fail() {
										clearTimeout(TimeID)
									}
								})
							}, 1000)
						}

					},
					fail(e) {
						wx.showToast({
							title: '支付失败',
							icon: 'none'
						})

						if (that.checkinfo.order_type == 4) {
							let getTimeOutId = setTimeout(function() {
								uni.reLaunch({
									url: "/pages/client/order/order?type=1",
									success() {
										clearTimeout(getTimeOutId) //释放定时
									}
								})
							}, 1500)
						} else {
							let TimeID = setTimeout(function() {
								uni.reLaunch({
									url: "/pages/client/order/order",
									success() {
										clearTimeout(TimeID)
									},
									fail() {
										clearTimeout(TimeID)
									}
								})
							}, 1000)
						}



					}
				})

			},
			getDay(day, hours) {
				var today = new Date()
				var targetday = today.getTime() + 1000 * 60 * 60 * 24 * day + hours
				today.setTime(targetday)
				var tYear = today.getFullYear()
				var tMonth = today.getMonth()
				var tDate = today.getDate()
				tMonth = this.doHandleMonth(tMonth + 1)
				tDate = this.doHandleMonth(tDate)
				return tYear + '-' + tMonth + '-' + tDate
			},
			doHandleMonth(month) {
				var m = month
				if (month.toString().length === 1) {
					m = '0' + month
				}
				return m
			},
			// 打开红包弹窗
			openHbPop() {
				this.$refs.popup4.open();
			},
			// 打开配送红包弹窗
			openPshbPop() {
				this.$refs.popup5.open();
			},
			closeShowPostagePop() {
				this.$refs.popup5.close();
			},
			/**
			 * 选择免运费红包
			 * @param {Object} index
			 */
			checkHbPostage(index) {
				this.free_postage_red_id = this.checkinfo.red_packet_data.free_ship[index].id
				this.check()
				this.$refs.popup5.close()
			},
			// 打开优惠弹窗
			openYhPop() {
				this.$refs.coupons.open()
			},
			// 红包类型弹窗关闭
			pop4Close() {
				this.$refs.popup4.close();
			},
			// 切换红包
			checkHb(index) {
				this.full_minus_red_id = this.checkinfo.red_packet_data.reduction[index].id
				this.$refs.popup4.close();
				this.check()
			},
			// 展开
			zhankai(index) {
				console.log("????/")
				this.hb_list[index].look = !this.hb_list[index].look;
			},
		}
	}
</script>
<style lang="scss">
	.addkuangkuang {
		width: 80rpx !important;
		height: 80rpx !important;
		display: flex;
		align-items: center;
		justify-content: center;
	}

	.addkuangkuang image {
		width: 40rpx !important;
		height: 40rpx !important;
	}

	page {
		background-color: #F5F5F5;
	}

	.cancelbox {
		// position: absolute;
		// top: 30rpx;
		// left: 30rpx;
		font-size: 24rpx;
		color: #666666;
	}

	.cart-btn {
		display: flex;
		justify-content: flex-end;
		// position: absolute;
		// right: 0;
		// bottom: 0;

		input {
			width: 60rpx;
			font-weight: 600;
			font-size: 28rpx;
			text-align: center;
		}

		.cart1-jian,
		.cart1-add {
			width: 40rpx;
			height: 40rpx;

			image {
				width: 100%;
				height: 100%;
			}
		}
	}
</style>
<style lang="scss" scoped>
	.box {
		padding-bottom: 140rpx;
		position: relative;

		.showColor {
			font-weight: bold;
			color: #F45E14;
		}

		.red {
			color: #F83535;
		}

		.bg {
			left: 0;
			top: 0;
			position: absolute;
			width: 750rpx;
			height: 252rpx;
			background: #109C7A;
		}

		.tag {
			margin-left: 15rpx;
			flex-shrink: 0;
			width: 11rpx;
			height: 20rpx;

			image {
				width: 100%;
				height: 100%;
			}
		}

		.list {
			position: relative;
			overflow: hidden;
			z-index: 2;
		}

		.card {
			margin: 0 auto;
			width: 690rpx;
			padding: 0 30rpx;
			background: #FFFFFF;
			border-radius: 20rpx;
			box-sizing: border-box;
		}

		.msg {
			margin-top: 37rpx;
			padding: 20rpx 30rpx 35rpx;

			.msg-left {
				flex: 1;
				min-height: 80rpx;
				font-size: 30rpx;
				font-weight: bold;
				// background-color: #18BC37;
			}

			.msg-range {
				font-size: 22rpx;
				font-weight: 400;
				color: #F56624;
			}

			.address {
				.tag {
					margin-top: 10rpx;
				}
			}

			.uname {
				margin-top: 8rpx;
				height: 28rpx;

				.msg-phone {
					margin-left: 20rpx;
				}
			}

			.time {
				margin-top: 24rpx;
			}

			.buy-msg {
				margin-top: 36rpx;
			}
		}

		.order {
			margin-top: 20rpx;
			padding: 28rpx 30rpx 20rpx;

			.order-list {
				margin-top: 5rpx;

				&>view:not(:first-child) {
					border-top: 1rpx solid #eee;
				}

				.shop {
					transition: 3s;
					padding: 23rpx 0;

					.shop-msg {
						width: 110rpx;
						height: 100rpx;
						flex-shrink: 0;

						image {
							width: 100%;
							height: 100%;
							border-radius: 12rpx;
						}
					}

					.shop-right {
						margin-left: 15rpx;
						flex: 1;
						min-height: 110rpx;

						.one {
							.shop-name {
								width: 308rpx;
							}

							.price1 {
								font-size: 24rpx;
								text-decoration: line-through;
								color: #999999;
							}

							.price2 {
								margin-left: 30rpx;
							}
						}

						.two,
						.three {
							font-size: 22rpx;
							color: #666;
						}

						.two {
							margin: 6rpx 0;
							height: 28rpx;
						}
					}
				}

			}

			// 
			.num {
				width: 630rpx;
				height: 40rpx;
				margin-bottom: 26rpx;
				background: #FAFAFA;
				color: #999999;
				font-size: 22rpx;

				.tag2 {
					margin-left: 10rpx;
					width: 16rpx;
					height: 9rpx;

					image {
						width: 100%;
						height: 100%;
					}
				}
			}

			// 费
			.fee1 {}

			.fee2 {
				margin-top: 36rpx;
			}

			// 红包类型
			.demo {
				margin-top: 36rpx;

				.img1 {
					width: 28rpx;
					height: 30rpx;

					image {
						width: 100%;
						height: 100%;
					}
				}

				.title2 {
					position: relative;
					margin-left: 10rpx;
					font-size: 28rpx;

					.img2 {
						top: -2rpx;
						right: -25rpx;
						position: absolute;
						width: 22rpx;
						height: 22rpx;

						image {
							width: 100%;
							height: 100%;
						}
					}
				}
			}

			.dixian {
				padding-left: 40rpx;
				margin-top: 10rpx;

				.dixian-img {
					width: 30rpx;
					height: 30rpx;

					image {
						width: 100%;
						height: 100%;
					}
				}
			}

			// 优惠
			.youhui {
				margin-top: 82rpx;

				.yyh {
					margin-top: 2rpx;
				}

				.xiaoji {
					// margin-top: 4rpx;
				}

				.youhui-total {
					position: relative;
				}

				.sanjiao {
					position: absolute;
					bottom: -20rpx;
					left: 50%;
					transform: translateX(-50%);
					width: 0;
					height: 0;
					border-bottom: 20rpx solid #FDECD7;
					border-right: 12rpx solid transparent;
					border-left: 12rpx solid transparent;
				}
			}

			.yh-plus {
				margin-top: 20rpx;
				width: 630rpx;
				padding: 0 13rpx;
				height: 86rpx;
				line-height: 86rpx;
				font-size: 26rpx;
				background: linear-gradient(0deg, #FFE0B4 0%, #FDECD7 100%);
				border-radius: 8rpx;
				box-sizing: border-box;

				.img3 {
					width: 30rpx;
					height: 26rpx;

					image {
						width: 100%;
						height: 100%;
					}
				}

				.tag3 {
					margin: 0 10rpx;
					width: 1rpx;
					height: 25rpx;
					background: #4D2F12;
				}
			}
		}

		// 备注
		.note {
			margin-top: 20rpx;
			padding: 38rpx 30rpx;

			.note-text {
				max-width: 500rpx;
			}
		}

		// 支付方式
		.pay {
			margin-top: 20rpx;
			padding: 30rpx 30rpx 10rpx;

			.img4 {
				margin-right: 30rpx;
				width: 50rpx;
				height: 50rpx;

				image {
					width: 100%;
					height: 100%;
				}
			}

			.tag4 {
				width: 30rpx;
				height: 30rpx;

				image {
					width: 100%;
					height: 100%;
				}
			}

			.wx {
				padding: 40rpx 0;
			}

			.yue {
				border-top: 1rpx solid #eee;
				padding: 40rpx 0;
			}
		}

		// 支付
		.btn {
			position: fixed;
			bottom: 0;
			left: 30rpx;
			width: 690rpx;
			height: 110rpx;
			// background: #FFFFFF;
			background-color: #f9ffff;
			border-radius: 55rpx;
			text-align: center;
			z-index: 11;

			.btn-left {
				width: 350rpx;

				.b1 {
					margin-top: 2rpx;
				}

				.b2 {
					margin-top: 12rpx;
				}
			}

			.btn-mid,
			.btn-right {
				width: 170rpx;
				height: 110rpx;
				line-height: 110rpx;
				color: #fff;
				background: linear-gradient(54deg, #7EDBC5, #6CD3BB);
			}

			.btn-right {

				background: linear-gradient(64deg, #2BCCA5, #22B591);

				border-radius: 0rpx 55rpx 55rpx 0rpx;
			}
		}

		// 备注弹窗
		.pop1 {
			width: 620rpx;
			background: #FFFFFF;
			border-radius: 16rpx;
			overflow: hidden;

			.title {
				margin-top: 35rpx;
			}

			textarea {
				margin: 20rpx auto;
				width: 551rpx;
				min-height: 270rpx;
				padding: 18rpx 18rpx;
				font-size: 28rpx;
				background: #F5F5F5;
				box-sizing: border-box;
			}

			.pop-btn {
				border-top: 1rpx solid #eee;

				&>view {
					width: 50%;
					height: 90rpx;
					line-height: 90rpx;
					text-align: center;
					color: #999;
				}

				.btn2 {
					border-left: 1rpx solid #eee;
					color: #F31E1E;
				}
			}
		}

		// 说明弹窗
		.pop2 {
			.pop2-content {
				width: 560rpx;
				padding: 40rpx;
				background: #FFFFFF;
				border-radius: 20rpx;
				box-sizing: border-box;
			}

			.pop2-close {
				margin: 22rpx auto 0;
				width: 58rpx;
				height: 58rpx;

				image {
					width: 100%;
					height: 100%;
				}
			}
		}

		// 配送时间弹窗
		.pop3 {
			position: relative;
			width: 750rpx;
			height: 540rpx;
			background: #FFFFFF;
			border-radius: 20rpx 20rpx 0rpx 0rpx;
			overflow: hidden;

			.green2 {
				color: #109C7A;
			}

			.pop3-close {
				position: absolute;
				top: 15rpx;
				right: 30rpx;
				width: 38rpx;
				height: 38rpx;

				image {
					width: 100%;
					height: 100%;
				}
			}

			.pop3-title {
				margin-top: 36rpx;
			}

			.pop3-box {
				height: 458rpx;
				font-size: 28rpx;

				.pop3-left {
					width: 140rpx;
					height: 458rpx;
					background-color: #FAFAFA;

					&>view {
						padding: 30rpx 0;
					}
				}

				.pop3-right {
					flex: 1;
					height: 458rpx;
					overflow-y: auto;

					&>view {
						padding: 30rpx 30rpx;
					}

					.pop3-img {
						width: 38rpx;
						height: 34rpx;

						image {
							width: 100%;
							height: 100%;
						}
					}
				}
			}
		}

		// 红包弹窗
		.pop4 {
			width: 750rpx;
			height: 745rpx;
			padding: 30rpx 0 0;
			background: #FFFFFF;
			border-radius: 30rpx 30rpx 0rpx 0rpx;
			box-sizing: border-box;

			.pop4-close {
				position: absolute;
				top: 15rpx;
				right: 30rpx;
				width: 38rpx;
				height: 38rpx;

				image {
					width: 100%;
					height: 100%;
				}
			}

			.pop4-list {
				margin-top: 30rpx;
				padding: 0 30rpx;
				height: 640rpx;
				overflow-y: auto;
			}

			.pop4-card {
				position: relative;
				width: 690rpx;
				min-height: 186rpx;
				background: #FFFFFF;
				border: 1rpx solid #FD9D9D;
				border-radius: 10rpx;
				margin-top: 20rpx;
				padding: 23rpx 28rpx 23rpx 0;
				box-sizing: border-box;

				.pop4-img {
					position: absolute;
					left: -15rpx;
					top: 50%;
					transform: translateY(-50%);
					width: 30rpx;
					height: 30rpx;
					background-color: #fff;

					image {
						width: 100%;
						height: 100%;
					}

					z-index: 12;
				}

				.left {
					flex-shrink: 0;
					width: 160rpx;
					height: 160rpx;
					border-right: 1rpx dashed #CCCCCC;
					text-align: center;
					color: #F83535;

					.price {
						margin-top: 28rpx;
					}

					.tj {
						margin-top: 6rpx;
						font-size: 24rpx;
						color: #666;
					}
				}

				.right {
					position: relative;
					flex: 1;
					margin-left: 30rpx;
					font-size: 28rpx;

					.lright-lq {
						position: absolute;
						right: 0;
						top: 50%;
						transform: translateY(-50%);
						width: 130rpx;
						height: 44rpx;
						text-align: center;
						line-height: 44rpx;
						font-size: 26rpx;
						color: #F83535;
						background: #FFFFFF;
						border: 1rpx solid #F83535;
						border-radius: 22rpx;
						z-index: 6;
					}


					.two {
						margin: 28rpx 0;
						color: #666;
					}

					.three {
						color: #999;
						font-size: 24rpx;
						overflow: hidden;

						.desc {
							flex: 1;
							width: 420rpx;
						}

						.icon {
							flex-shrink: 0;
							margin-left: 20rpx;
							width: 26rpx;
							height: 14rpx;

							image {
								width: 100%;
								height: 100%;
							}
						}
					}
				}
			}
		}
	}
</style>
